<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script src="${ctx}/libjs/plugins/elecStationPicker/js/elecStationData.min.js"></script>
    <script src="${ctx}/libjs/plugins/elecStationPicker/js/elecStationPicker-2.0.4.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/elecStationPicker/css/index.css">
    <script type="text/javascript" src="${ctx}/appjs/statistics/chargingStatistics.js"></script>
    <style>
        .ml-30{
            margin-left: 30px !important;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>统计</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>充电统计</strong>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content " style="overflow-x: scroll">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <%--<div class="columns pull-left">--%>
                    <%--<button type="button" class="btn  btn-primary" onclick="order.addOrder()">--%>
                    <%--增加桩群--%>
                    <%--</button>--%>
                    <%--</div>--%>
                    <div class="pull-left search ml-30">
                        <input id="startTime" name="startTime" type="text" class="form-control"
                               placeholder="开始时间">
                    </div>
                    <div class="pull-left search ml-30">
                        <input id="endTime" name="endTime" type="text" class="form-control"
                               placeholder="结束时间">
                    </div>

                    <div class="pull-left search ml-30">
                        <button class="btn btn-success" onclick="chargingStatistics.reLoad()">查询</button>
                    </div>
                </div>
                <input type="hidden" id="userType" name="userType" value="${userType}">
                <input type="hidden" id="code" name="code" value="${code}">
                <%--//普通运营商桩群组件--%>
                <c:if test="${userType eq '0'}">
                <div class="row" style="padding-bottom: 0.1rem;!important;padding-top: 0 !important;">
                    <div class="dome-main">
                        <div class="city-picker-selector" id="city-picker-search"></div><!-- end .city-picker-selector -->
                        <input type="hidden" class="bizType" id="bizType" name="bizType">
                        <input type="hidden" class="elecStationId" id="elecStationId" name="elecStationId">
                    </div>

                </div>
                </c:if>
                <%--//普通运营商桩群组件--%>
                <%--//分销商组件--%>
                <c:if test="${userType eq '1'}">
                <div class="row" style="padding-top: 0 !important;">
                    <div class="reseller-dome-main">
                        <div class="city-picker-selector" id="city-picker-search-reseller"></div><!-- end .city-picker-selector -->
                        <input type="hidden" class="bizType" id="bizType" name="bizType">
                        <input type="hidden" class="elecStationId" id="elecStationId" name="elecStationId">
                    </div>
                </div>
                </c:if>
                <%--//分销商组件--%>
                <table id="exampleTable" data-mobile-responsive="true">
                    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                    <div id="main" style="width: 1500px;height:400px;margin: 10px auto"></div>
                </table>

            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }
    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');

    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var startTime = laydate.render({
            elem: '#startTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click',
            done: function (value, dates) {
                // var month = dates.month;
                // var date = dates.date;
                // if(month<10){
                //     month = "0"+month
                // }
                // if(date<10){
                //     date = "0"+date
                // }
                // $("#endTime").val(dates.year+"-"+month+"-"+date+" 23:"+"59:"+"59");
                $("#endTime").val("");
                endTime.config.min = {
                    year: dates.year,
                    month: dates.month - 1, //关键
                    date: dates.date,
                    hours: 0,
                    minutes: 0,
                    seconds: 0
                };
            }
        });
        var endTime = laydate.render({
            elem: '#endTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click'
        });

    });

    chargingStatistics.init();
</script>
</body>
</html>